Micron Document
<!DOCTYPE html>
<html class="client-nojs vector-feature-night-mode-disabled vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-sticky-header-enabled" lang="en" dir="ltr"><head>
<meta charset="UTF-8">
<title>Event-driven messaging</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="https://en.wikipedia.org/wiki/Event-driven_messaging"> <link href="./mw/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/user.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./mw/site.styles.css">
<link rel="stylesheet" type="text/css" href="./mw/noscript.css">
<link rel="stylesheet" type="text/css" href="./footer.css">
<link rel="stylesheet" type="text/css" href="./vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Event-driven_messaging rootpage-Event-driven_messaging skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading">
<span id="openzim-page-title" class="mw-page-title-main"><span class="mw-page-title-main">Event-driven messaging</span></span>
</h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr"><p>
The <b>event-driven messaging</b> is a <a href="Design_pattern" title="Design pattern">design pattern</a> to enable the service consumers, which are interested in events that occur within the periphery of a service provider, to get notifications about these events as and when they occur without resorting to the traditional inefficient <a href="Polling_(computer_science)" title="Polling (computer science)">polling</a> based mechanism.<sup id="cite_ref-IIT_1-0" class="reference"><a href="#cite_note-IIT-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup>
</p><p>It's important to differentiate between event-driven and <a href="Message_queue" title="Message queue">message-driven (aka queue driven)</a> services: Event-driven services (e.g. <a href="Amazon_Simple_Notification_Service" title="Amazon Simple Notification Service">AWS SNS</a>) are decoupled from their consumers. Whereas queue / message driven services (e.g. <a href="Amazon_Simple_Queue_Service" title="Amazon Simple Queue Service">AWS SQS</a>) are coupled with their consumers. <sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup>
</p>
<meta property="mw:PageProp/toc">
<div class="mw-heading mw-heading2"><h2 id="Rationale">Rationale</h2></div>
<p>The interaction between a service consumer and a <a href="Service_provider" title="Service provider">service provider</a> is normally initiated by the service consumer as it needs to respond to an event that occurs within the boundary of the service consumer itself, e.g. requiring some data from an external resource (i.e. the service provider) in order to perform a calculation whose results need to be relayed back to a <a href="User_interface" title="User interface">user interface</a> in response to an action performed by the user.<sup id="cite_ref-3" class="reference"><a href="#cite_note-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup> However, there are situations where the service consumer needs to wait for the occurrence of an event within the boundary of the service provider itself. Under these circumstances, the service consumer somehow needs to be informed of the event as and when it happens. One way is to program the service consumer to poll the service provider with regular intervals so that it can check if the event happened or not. This approach not only manifests inefficiency but also behavioral unpredictability. Inefficiency because the service consumer and the service provider are engaged in unproductive interactions and unreliable because it might be that the event actually happened more than once before the service consumer could poll the service provider, thereby missing the previous events and their related data. Apart from these problems, such a technique also introduces latency as the interval with which the service consumer performs the polling is fixed and, therefore, it would only fetch the event data at that time and not when the event actually occurred. This whole scenario deteriorates even further if multiple service consumers are dependent on a particular service provider.
</p><p>In order to tackle this problem, the event-driven messaging design pattern suggests a <a href="Publish/subscribe" class="mw-redirect" title="Publish/subscribe">publisher-subscriber communication mechanism</a> that ensures timely notification of event related data to the service consumer,<sup id="cite_ref-Mauro_Comp_4-0" class="reference"><a href="#cite_note-Mauro_Comp-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup> thereby eliminating the inefficiencies linked with the traditional polling based communication mechanism.
</p>
<div class="mw-heading mw-heading2"><h2 id="Usage">Usage</h2></div>


<p>The application of the event-driven messaging design pattern requires an event manager with whom the service provider registers its events. The service consumers then register their interest in few or all of the advertised events. Upon the occurrence of an event, the service provider informs the event manager that then notifies all the registered service consumers instantly.<sup id="cite_ref-Mauro_5-0" class="reference"><a href="#cite_note-Mauro-5"><span class="cite-bracket">[</span>5<span class="cite-bracket">]</span></a></sup> This communication mechanism shares its roots with the <a href="Observer_pattern" title="Observer pattern">Observer pattern</a> applied traditionally within the <a href="Object-oriented_design" class="mw-redirect" title="Object-oriented design">object-oriented</a> world.<sup id="cite_ref-Mauro_5-1" class="reference"><a href="#cite_note-Mauro-5"><span class="cite-bracket">[</span>5<span class="cite-bracket">]</span></a></sup> This design pattern also borrows some concepts from the <a href="Event_Driven_Architecture" class="mw-redirect" title="Event Driven Architecture">Event-Driven Architecture</a> as the fundamental rationale behind this design pattern is responding to events.<sup id="cite_ref-SOAWorldMag_6-0" class="reference"><a href="#cite_note-SOAWorldMag-6"><span class="cite-bracket">[</span>6<span class="cite-bracket">]</span></a></sup>
</p><p>The actual implementation of such a publisher–subscriber-based communication mechanism requires architectural extensions in order to provide such a complex message tracking and forwarding mechanism. A mature <a href="Enterprise_service_bus" title="Enterprise service bus">ESB</a> product should normally be able to provide such functionality. The application of this pattern helps to further decouple<sup id="cite_ref-CouplingTypes_7-0" class="reference"><a href="#cite_note-CouplingTypes-7"><span class="cite-bracket">[</span>7<span class="cite-bracket">]</span></a></sup> the service consumers from the service providers and increases the overall reliability of a service composition.
</p>
<div class="mw-heading mw-heading2"><h2 id="References">References</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1239543626">
/* start https://en.wikipedia.org/ */


.mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}


/* end https://en.wikipedia.org/ */
</style><div class="reflist">
<div class="mw-references-wrap"><ol class="references">
<li id="cite_note-IIT-1"><span class="mw-cite-backlink"><b><a href="#cite_ref-IIT_1-0">^</a></b></span> <span class="reference-text">Wajid Khattak, Vijay Narayanan.<a rel="nofollow" class="external text" href="http://www.informit.com/articles/article.aspx?p=1577450">Event-Driven Messaging</a>[Online].Date accessed: 27 April 2010.</span>
</li>
<li id="cite_note-2"><span class="mw-cite-backlink"><b><a href="#cite_ref-2">^</a></b></span> <span class="reference-text"><style data-mw-deduplicate="TemplateStyles:r1238218222">
/* start https://en.wikipedia.org/ */


.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("./mw/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("./mw/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("./mw/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("./mw/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#d33)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#d33)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}


/* end https://en.wikipedia.org/ */
</style><cite class="citation book cs1"><i>Domain-Driven Design with Java - A Practitioner's Guide</i>. 2022. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>9781800564763</bdi>.</cite></span>
</li>
<li id="cite_note-3"><span class="mw-cite-backlink"><b><a href="#cite_ref-3">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://qbdgroup.com/en/a-complete-guide-to-computer-system-validation/">"A Complete Guide to Computer System Validation (CSV): What is it and why do we need it?"</a>. <i>QbD Group</i><span class="reference-accessdate">. Retrieved <span class="nowrap">23 May</span> 2023</span>.</cite></span>
</li>
<li id="cite_note-Mauro_Comp-4"><span class="mw-cite-backlink"><b><a href="#cite_ref-Mauro_Comp_4-0">^</a></b></span> <span class="reference-text">Mauro. et al. <a rel="nofollow" class="external text" href="http://www.computer.org/portal/web/csdl/doi/10.1109/HICSS.2010.336">Service Oriented Device Integration – An Analysis of SOA Design Patterns.</a> <a rel="nofollow" class="external text" href="https://web.archive.org/web/20110203194511/http://www.computer.org/portal/web/csdl/doi/10.1109/HICSS.2010.336">Archived</a> 3 February 2011 at the <a href="Wayback_Machine" title="Wayback Machine">Wayback Machine</a> [Online], pp.1–10, 2010 43rd Hawaii International Conference on System Sciences, 2010. Date accessed: 4 April 2010.</span>
</li>
<li id="cite_note-Mauro-5"><span class="mw-cite-backlink">^ <a href="#cite_ref-Mauro_5-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-Mauro_5-1"><sup><i><b>b</b></i></sup></a></span> <span class="reference-text">Mauro et al. <a rel="nofollow" class="external text" href="https://home.in.tum.de/~sunyaev/papers/soda1v3.pdf">Standardized Device Services – A Design Pattern for Service Oriented Integration of Medical Devices</a> [Online].Date accessed: 4 April 2010.</span>
</li>
<li id="cite_note-SOAWorldMag-6"><span class="mw-cite-backlink"><b><a href="#cite_ref-SOAWorldMag_6-0">^</a></b></span> <span class="reference-text"><a href="Thomas_Erl" title="Thomas Erl">Thomas Erl</a>.<a rel="nofollow" class="external text" href="http://soa.sys-con.com/node/645271?page=0,2">Introducing SOA Design Patterns</a> <a rel="nofollow" class="external text" href="https://web.archive.org/web/20100913104647/http://soa.sys-con.com/node/645271?page=0,2">Archived</a> 13 September 2010 at the <a href="Wayback_Machine" title="Wayback Machine">Wayback Machine</a>[Online].Date accessed: 4 April 2010.</span>
</li>
<li id="cite_note-CouplingTypes-7"><span class="mw-cite-backlink"><b><a href="#cite_ref-CouplingTypes_7-0">^</a></b></span> <span class="reference-text">Coupling Types</span>
</li>
</ol></div></div>
<ul><li><a href="Thomas_Erl" title="Thomas Erl">Erl</a> et al.,(2009).<a rel="nofollow" class="external text" href="https://www.amazon.com/dp/0136135161">SOA Design Patterns</a>. Prentice Hall. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>0-13-613516-1</bdi>.</li>
<li>Michael Stal.<a rel="nofollow" class="external text" href="https://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=1605179">Using Architectural Patterns and Blueprints for Service-Oriented Architecture</a>[Online].Date accessed: 1 May 2010.</li></ul>
<div class="mw-heading mw-heading2"><h2 id="External_links">External links</h2></div>
<ul><li><a rel="nofollow" class="external text" href="https://patterns.arcitura.com/soa-patterns">SOA Patterns</a></li></ul></div><!--htdig_noindex--><div><div class="zim-footer">
This article is issued from <a class="external text" title="Last edited on 2024-07-31" href="https://en.wikipedia.org/wiki/?title=Event-driven_messaging&amp;oldid=1237708030">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>

</body></html>